import http from '../../../../../utils/http';
import React, { useState } from 'react';
import { Modal, Button } from 'antd'
function ModaldelE(props) {
        // 删除
    const [isModalVisible3, setIsModalVisible3] = useState(false);

    const showModal3 = () => {
        setIsModalVisible3(true);
    };

    const handleOk3 = () => {
        setIsModalVisible3(false);
        http({
            url:'/configuration/del',
            method:'post',
            data:{
                Question_id:props.content.Question_id
            }
        }).then((res)=>{
            // console.log(res);
            if(res){
                props.fn();
                props.pagingtotal();
                setIsModalVisible3(false);
            }
        })
    };

    const handleCancel3 = () => {
        setIsModalVisible3(false);
    };
    // 模态框title
    const CustomTitle3 = () => {
        return (
            <div className='CustomTitle_title'>
                提示
            </div>
        )
    }
    return (
        <div>
            <a onClick={showModal3}>删除</a>
            <Modal cancelText='返回' okText='确认' width="715px" title={<CustomTitle3 ></CustomTitle3>} visible={isModalVisible3} onOk={handleOk3} onCancel={handleCancel3} footer={[
                <Button id="ModalseeS3Btn1" key="back" onClick={handleCancel3}>返回</Button>,
                <Button id="ModalseeS3Btn2" key="submit" type="primary" onClick={handleOk3}>
                    确认
                </Button>,
            ]}>

                <div className="ModalseeS3">
                    <p className="ModalseeS3_c1">确定将该分值删除?</p>
                    <p className="ModalseeS3_c2">删除后包含该分值的内容将无法显示</p>
                </div>
            </Modal>
        </div>
    )
}
export default ModaldelE